home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 1.iso / desktop / dibquant.zip / README.TXT < prev    next >
Text File  |  1994-06-17  |  2KB  |  65 lines

  1. DIBQuant 1.0
  2. ============
  3.  
  4. DIBQuant is a dll that performs color quantization on 24-bit Device
  5. Independent Bitmaps.  You can choose from several palette generation
  6. and dithering methods.  DIBQuant is being distributed as freeware,
  7. use it without restriction.
  8.  
  9. The interface is one function call:
  10.  
  11. LPSTR FAR PASCAL QuantizeDIB(LPSTR lpDIB, int nPalette, int nDither,
  12.                              FARPROC lpStatus);
  13.  
  14. lpDIB is a pointer to a 24 bit DIB.
  15.  
  16. nPalette specifies the method to be used to generated the palette.  Valid 
  17. values are:
  18.  
  19. #define IDX_MEDIAN          0       /* perform median cut */
  20. #define IDX_POPULARITY      1       /* perform popularity sort */
  21. #define IDX_DEFAULT         2       /* use default palette */
  22.  
  23. nDither specifies the dithering method to use.  Valid values are:
  24.  
  25. #define IDX_NONE            0       /* no dither */
  26. #define IDX_ORDERED         1       /* ordered dither */
  27. #define IDX_JITTER          2       /* jitter preprocessing */
  28.  
  29. lpStatus is a pointer to a function used to update the status of the
  30. operation.  DIBQuant calls it to update progress.  It's useful for
  31. large images that may take a while to process.  It can be NULL if you 
  32. don't want DIBQuant to update the status.
  33.  
  34. The call must have the format:
  35.  
  36. void FAR PASCAL UpdateStatus(LPCSTR lpString)
  37. {
  38.  ... whatever...
  39. }
  40.  
  41. You'll need to do something like this...
  42.  
  43. FARPROC lpStatus = MakeProcInstance(UpdateStatus,hInstace);
  44. QuantizeDIB(lpDIB,nPalette,nDither,lpStatus);
  45. FreeProcInstance(lpStatus);
  46.  
  47. QuantizeDIB returns a pointer to an quantized, 8-bit version of the
  48. original DIB.  It was allocated with GlobalAllocPtr.  NULL is returned
  49. if something goes wrong.
  50.  
  51. That's all there is to it.  Feel free to send me feedback.  You're
  52. welcome to use it in your program and distribute it far and wide provided
  53. the original copyright notices are attached.  If you distribute the 
  54. archive file please include all of the original files.
  55.  
  56. Finally, the code to perform the median cut algorithm is based upon code
  57. I found on the network.  No names or copyright notices were attached, so
  58. I assume there isn't a problem using it.  If anyone knows who it belongs to
  59. please let me know.
  60.  
  61. Eddie McCreary
  62. June 17, 1994
  63. edm@twisto.compaq.com
  64.  
  65.